<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    .active {
        color: red;
    }
</style>

<body>
    <div id="app">
        <ul>
            <li v-for="(movie,index) in movies" :class="{active: currentIndex === index}" @click="getCurrentIndex(index)">{{movie}}</li>
        </ul>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                movies: ["海王", "闻香识女人", "史莱克", "斗罗大陆"],
                currentIndex: 0
            },
            methods: {
                getCurrentIndex(index) {
                    this.currentIndex = index
                }
            }
        })
    </script>
</body>

</html>